package main.java.PinDuoDuo;

import java.util.Scanner;
import java.util.Arrays;
public class Main {

    public static void main(String args[]) {

        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();

        int  [] mat = new int [num];
        for(int i =0;i<num;i++){
            mat[i]=scanner.nextInt();
        }

        int i = lengthOfLIS(mat);
        System.out.println(i);

    }
    public static int lengthOfLIS(int[] nums) {
        int n = nums.length;
        int[] dp = new int[n];
        for (int i = 0; i < n; i++) {
            int max = 1;
            for (int j = 0; j < i; j++) {
                if (nums[i] > nums[j]) {
                    max = Math.max(max, dp[j] + 1);
                }
            }
            dp[i] = max;
        }
        //return Arrays.stream(dp).max().orElse(0);
        return 1;
    }
}